class House:
    def __init__(self, name, total_area):
        self.name = name
        self.total_area = total_area
        self.free_area = total_area
        self.item_list = []

    def __str__(self):
        return f'户型：{self.name}，总面积：{self.total_area}m2，剩余面积：{self.free_area}m2，现有家具{self.item_list}'

    def add_item(self, item):
        if self.free_area >= item.area:
            self.free_area -= item.area
            self.item_list.append(item.name)
        else:
            print(f'{self.name}的剩余面积不足，添加{item.name}家具失败')


class HouseItem:
    def __init__(self, name, area):
        self.name = name
        self.area = area


    def __str__(self):
        return f'家具名：{self.name}，占地面积：{self.area}m2'


black_House = House('黑屋', 100)
sofa = HouseItem('沙发', 15)
desk = HouseItem('桌子', 10)
bed = HouseItem('床', 40)

print(black_House)
black_House.add_item(sofa)
print(black_House)
black_House.add_item(desk)
black_House.add_item(bed)
print(black_House)
black_House.add_item(desk)
print(black_House)
